package com.anpy.management.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 语言类型枚举
 */
@Getter
@AllArgsConstructor
public enum LanguageTypeEnum {
    
    JAVA("JAVA", "Java"),
    ANDROID("ANDROID", "Android"),
    PYTHON("PYTHON", "Python"),
    JAVASCRIPT("JAVASCRIPT", "JavaScript"),
    TYPESCRIPT("TYPESCRIPT", "TypeScript"),
    GO("GO", "Go"),
    CPP("CPP", "C++"),
    C("C", "C"),
    CSHARP("CSHARP", "C#"),
    OTHER("OTHER", "其他");
    
    private final String code;
    private final String desc;
    
    public static LanguageTypeEnum getByCode(String code) {
        for (LanguageTypeEnum type : LanguageTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
